﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommerceOne.Domains.Entities;

namespace CommerceOne.Domains.Commons
{
    public class SearchProductResult
    {
        public string Keyword { get; set; }
        public int Total { get { return this.ResultItem == null ? 0 : this.ResultItem.Count; } }
        public decimal? MaxPrice { get; set; }
        public decimal? MinPrice { get; set; }
        public List<Product> ResultItem { get; set; }

        public List<Product> GetProduct(int page, int pageSize)
        {
            int skip = (page - 1) * pageSize;
            List<Product> products = this.ResultItem.Skip(skip).Take(pageSize).ToList();
            return products;
        }
    }
}
